from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime

class FetchTokenSchema(BaseModel):
    username: str           = Field(description="用户名")
    password: str           = Field(description="密码")
    captcha: Optional[str]  = Field(default='', description="验证码")
    
class PayLoad(BaseModel):
    user_id: int                    = Field(description="用户ID")
    exp: Optional[datetime]        = Field(description="过期时间")
    
class TokenBack(BaseModel):
    access_token: str       = Field(description="token")
    token_type: str         = Field(default="Bearer", description="token 类型")